package yedean.bean;

import com.yedean.factory.BeansException;
import com.yedean.factory.config.BeanPostProcessor;

public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if ("userService".equals(beanName)){
            UserService userService =(UserService) bean;
            userService.setLocation("杭州");
        }
        return bean;
    }

    @Override
    public Object postProcessAfterIntialization(Object bean, String beanName) throws BeansException {
        return bean;
    }
}
